import { createSSRApp } from 'vue'

//解决挂载请求pinia未加载问题
import { pinia, Pinia } from '@/store'
import uViewPlus from '@/libs/uview-plus'
import App from './App.vue'
import api from '@/apis/api'
import { addVConsole } from '@/libs/utils/debug'
import vueProtoType from '@/libs/prototype'
// 挂载全局请求
uni.$Api = api

// 开启控制台
// #ifdef H5
addVConsole()
// #endif

export function createApp() {
  const app = createSSRApp(App)
  app.use(pinia)
  app.use(uViewPlus)
  app.use(vueProtoType)
  return {
    app,
    Pinia
  }
}
